<?php

use Illuminate\Support\Facades\Schema;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Database\Migrations\Migration;

class CreateStusTable extends Migration
{
    /**
     * Run the migrations.
     *
     * @return void
     */
    public function up()
    {
        Schema::create('stus', function (Blueprint $table) {
            $table->increments('id');
            $table->string('weixiao_stu_id')->nouNull()->default('')->comment('微校openid');
            $table->integer('school_id')->notNull()->default(0)->comment('主体id');
            $table->string('card_number')->notNull()->default('')->comment('卡号');
            $table->string('name')->notNull()->default('')->comment('姓名');
            $table->integer('gender')->notNull()->default(0)->comment('性别 0男 1女');
            $table->string('head_image')->notNull()->default()->comment('头像');
            $table->integer('identity_type')->notNull()->default(0)->comment('身份类型 1学生 2教职工 3校友 4其它');
            $table->string('grade')->notNull()->default('')->comment('年级');
            $table->string('campus')->notNull()->default('')->comment('学校');
            $table->string('employer')->notNull()->default('')->comment('工作单位');
            $table->string('dorm_number')->notNull()->default('')->comment('宿舍号');
            $table->string('physical_chip_number')->notNull()->default('')->comment('物理芯片号');
            $table->string('physical_card_number')->notNull()->default('')->comment('物理卡号');
            $table->string('nation')->notNull()->default('汉族')->commen('名族');
            $table->string('birthday')->notNull()->default('')->comment('生日');
            $table->string('origin_place')->notNull()->default('')->comment('生源地');
            $table->string('graduated_school')->notNull()->default('')->comment('毕业院校');
            $table->string('address')->notNull()->default('')->comment('地址');
            $table->string('qq')->notNull()->default('')->comment('qq号');
            $table->string('email')->notNull()->default('')->comment('邮箱');
            $table->integer('card_type')->notNull()->default(0)->comment('卡类型 0身份证 1港澳通行证 2护照');
            $table->string('identity_title')->notNull()->default('')->comment('身份标识');
            $table->string('college')->notNull()->default('')->comment('学院');
            $table->string('profession')->notNull()->default('')->comment('专业');
            $table->string('class')->notNull()->default('')->comment('班级');
            $table->string('id_card')->notNull()->default('')->comment('身份证号');
            $table->string('country')->notNull()->default('中国')->comment('国籍');
            $table->string('telephone')->notNull()->default('')->comment('电话');
            $table->string('start_at')->notNull()->default('')->comment('有效期起始时间');
            $table->string('expire_at')->notNull()->default('')->comment('有效期结束时间');
            $table->tinyInteger('bind_status')->comment('绑定状态 0-未绑定 1-已绑定');
            $table->tinyInteger('active_status')->comment('激活状态 0-未激活 1-已激活');
            $table->tinyInteger('entrust_status')->comment('签约状态 0-未签约 1-已签约');
            $table->tinyInteger('frozen_status')->comment('冻结状态 0-未冻结 1-已冻结');
            $table->string('organization')->notNull()->default('')->comment('所属组织架构');
            $table->string('role')->notNull()->default('')->comment('角色');
            $table->string('school_code')->notNull()->default('')->comment('学校code');
            $table->timestamps();
        });
    }

    /**
     * Reverse the migrations.
     *
     * @return void
     */
    public function down()
    {
        Schema::dropIfExists('stus');
    }
}
